const number=document.querySelectorAll('.bofangliang')
const word=document.querySelectorAll('.word')
const name=document.querySelectorAll('.name')
const imgs=document.querySelectorAll('img')

axios.defaults.baseURL = 'http://dkzbkn.natappfree.cc'
axios.get("/songList",{
}).then(({data:{data}})=>{
    console.log(data); 
    // imgs.src=data[0].picture
    // imgs.src=data[1].picture
    data.forEach((item,index)=>{
        console.log(item);
        imgs[index].src=item.picture;
        word[index].innerHTML=item.title;
        name[index].innerHTML=item.author;
        number[index].innerHTML=item.accmount;
    })
});

// function showPage(pageNumber) {
//   // 隐藏所有页面内容区域
//   const pageContents = document.querySelectorAll('.page-content');
//   pageContents.forEach((element) => {
//       element.classList.remove('active');
//   });

//   // 显示选定的页面内容区域
//   const selectedPage = document.getElementById(`page${pageNumber}`);
//   if (selectedPage) {
//       selectedPage.classList.add('active');
//   }
// }


// 底部播放栏
const bottomBar = document.querySelector('.playBar');
        
window.addEventListener('mousemove', function (e) {
  const windowHeight = window.innerHeight;
  const mouseY = e.clientY;
  const triggerDistance = 50;
  // 距离底部 50px 触发显示
        
  if (windowHeight - mouseY < triggerDistance) {
  // 鼠标接近底部
  bottomBar.style.opacity = '1';
  bottomBar.style.visibility = 'visible';
  } else {
   // 鼠标离开底部
  bottomBar.style.opacity = '0';
  bottomBar.style.visibility = 'hidden';
    }
  });
